<?php 
 
 	##############
	#	HOCTIL NDS     #
	###################################################################################
   
   /**
    *
    * FILE:          phpheader.php
    * LOCATION:      /root/includes/
    * REFERENCES:    admin.php
    *                index.php 
    * FUNCTION:      starts session and tests if user is already
    *                logged in to access this page
    * DEPENDENCIES:  none
    *                
    * ==============================================================================
    * 
    * @version $Id: phpheader.php,v 0.1 2009/01/01
    * @copyright Copyright (c) none
    * @author ChrisV
    * 
    * ==============================================================================
    */
	
	#track login session
	session_start();
	#have this enabled to hide errors on localhost
	error_reporting(0);

	######################
	#CONFIGURATION SETTINGS   #
	###############################################################################
	
	# CIL CONSTANT 
	 define("THIS_CIL","HOCTIL");
	
	#DEFINE OUR BASE DIRECTORY USING ABSOLUTE PATH
	# production 
	//$BASE = "/home/decentda/public_html/ndsdatabase/hoctil/live";
	
	# development
	$BASE = "./";
	
	# set return to login path
	function return_to_login_page(){
		###############################################
		####	MAKE SURE THIS POINTS TO THE CORRECT LOGIN PAGE      #
		###############################################
		
		#production path
		header("Location: http://www.ndsdatabase.org/hoctil/live/index.php");
		
		#development path on localhost
		header("Location: ./index.php");
	}
   
	if(!isset($_SESSION['logged_in'])){
		header("Location:index.php?Status=You must login before accessing this page.");
	}else{
		$loggedIn       		=  $_SESSION['logged_in'];
		$loggedInUserID	 = $_SESSION['user_id'];
	}
	
	#lets initialize our dependency files
	require_once('./core_lib/core_functions.php');
?>